#pragma once
#include "CWideningSink.h"

class CRail;

class CShapeWideningSink :
	public CWideningSink
{

public: 
	CShapeWideningSink(CCoreServices * pCore, XFLOAT rTolerance);
	virtual ~CShapeWideningSink();
	virtual HRESULT StartWith(const struct XPOINTF * ptOffset);
	virtual HRESULT QuadTo(const struct XPOINTF * ptOffset, const struct XPOINTF & vecSeg, const struct XPOINTF & ptSpine, const struct XPOINTF & ptSpinePrev);
	virtual HRESULT QuadTo(const struct XPOINTF * ptOffset);
	virtual HRESULT CurveWedge(enum _RAIL_SIDE side, const struct XPOINTF & ptBez_1, const struct XPOINTF & ptBez_2, const struct XPOINTF & ptBez_3);
	virtual HRESULT BezierCap(const struct XPOINTF & __formal, const struct XPOINTF & pt0_1, const struct XPOINTF & pt0_2, const struct XPOINTF & ptMid, const struct XPOINTF & pt1_1, const struct XPOINTF & pt1_2, const struct XPOINTF & ptEnd);
	virtual HRESULT SetCurrentPoints(const struct XPOINTF * P);
	virtual HRESULT DoInnerCorner(enum _RAIL_SIDE side, const struct XPOINTF & ptCenter, const struct XPOINTF * ptOffset);
	virtual HRESULT CapTriangle(const struct XPOINTF & ptStart, const struct XPOINTF & ptApex, const struct XPOINTF & ptEnd);
	virtual HRESULT CapFlat(const struct XPOINTF * ppt, enum _RAIL_SIDE side);
	virtual HRESULT SwitchSides();
	virtual HRESULT PolylineWedge(enum _RAIL_SIDE side, XUINT32 count, const struct XPOINTF * pPoints);
	virtual const struct XPOINTF GetCurrentPoint(enum _RAIL_SIDE side);
	virtual HRESULT AddFigure();
private: 
	CCoreServices * m_pCore;
	CRail * m_pRail[2];
	XINT32 m_fFitCurves;
	XFLOAT m_rTolerance;
};